package com.lenovo.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Descpription 反馈拦截器
 * @Author CJF
 * @Date 2019/1/17 10:49
 **/

@Component
public class FeedBackInterceptor implements HandlerInterceptor {
    /**
     * 查看反馈 的权限码值 为64
     * 二进制1000000（7位）
     */
    final static Integer FEEDBACK_LEVEL_NUM = 64;

    @Autowired
    private IfPermission ifPermission;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        return ifPermission.CheckPermission(FEEDBACK_LEVEL_NUM, request, response);
    }

}
